<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%
  String xm = this.getServletContext().getInitParameter("path");
	String path1 = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+"/"+xm;
%>  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>添加支付信息</title>

<base target="_self" />
    
    <link href="<%=path1%>/ht/Styles/css.css" rel="stylesheet" type="text/css" />
    <link href="<%=path1%>/ht/Styles/ts_css.css" rel="stylesheet" type="text/css" />
    <script src="<%=path1%>/ht/Scripts/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
    <script src="<%=path1%>/ht/Scripts/jquery-1.4.1.min.js" type="text/javascript"></script>
    <script src="<%=path1%>/ht/Scripts/IndexManager.js" type="text/javascript"></script>
    
<script type="text/javascript">
   //添加支付信息
   function addAjax(){
	   alert("走");
	   $.ajax({
		   data:{
			   pay_type_id:$("#pay_type_id").val(),
			   opening_report_id:$("#opening_report_id").val(),
			   delete_state:$("#delete_state").val()
		   },
		   type:"post",
		   datatype:'json',
		   url:"<%=path1%>/ht/opening/addOpening.do",
		   error:function(data){
			   alert(data);
			   alert("出错了");
		   },
		   success:function(data){
			   alert(data);
			   alert("支付添加成功");
			   window.location.href="<%=path1%>/ht/opening/selectAll.do";
			   
		   }
	   });
   }
   

	//关闭当前页面
	function page_Close() {
		if (window.parent != null) {
			window.parent.close();
		} else {
			window.close();
		}
	}
</script>
<script type="text/javascript">
      function pay_type_ids(){
    	  var pay_type_id=$("#pay_type_id").val();
    	  if(pay_type_id="" || pay_type_id==null){
    		  alert("付款方式编号不能为空");
    		  $("#pay_type_id").focus();
    		  return false;
    	  }
    	  return true;
      }
      
      function opening_report_ids(){
    	  var opening_report_id=$("#opening_report_id").val();
    	  if(opening_report_id="" || opening_report_id==null){
    		  alert("开盘报告不能为空");
    		  $("#opening_report_id").focus();
    		  return false;
    	  }
    	  return true;
      }

   </script>
</head>
<body>
    
	<form id="form1" method="post">
		<div id="divTwo">
			<table width="100%" border="0" cellpadding="3" cellspacing="3"
				class="table_list1">
				<h2 align="center">添加支付信息</h2>
				<tr>
					<td width="50%" class="table_list1_style1">
						<p></p> <span style="color: Red">*</span> 付款方式编号:
					</td>
					<td width="50%" class="table_list1_style2"><input type="text"
						id="pay_type_id" name="pay_type_id" onblur="pay_type_ids()"/></td>

				</tr>
				<tr>
									<td width="10%" class="table_list1_style1">
						<p></p> <span style="color: Red">*</span> 开盘报告编号:
					</td>
					<td width="10%" class="table_list1_style2"><input type="text"
						id="opening_report_id" name="opening_report_id" onblur="opening_report_ids()"/></td>
				</tr>
				<tr>
					<td class="table_list1_style1">

						<p></p> <input type="button" id="send" value="添加" tabindex="1"
						class="button" onclick="addAjax();" /> &nbsp;
					</td>
					<td  width="1%" class="table_list1_style2">

						<p></p> <input type="button" class="button" value="关闭"
						tabindex="1" onclick="page_Close()" />
					</td>
					<td class="table_list1_style1">&nbsp;</td>
				</tr>
			</table>
		</div>
	</form>
</body>
</html>